CalculationResult

data class CalculationResult(val strategy: IRR.SolveStrategy? = null, val seedRate: Double? = null, val irr: Double? = null, val didSolve: Boolean = false)

Stores a single IRR calculation result (which may or may not have been successful)

Since

MD2027

Constructors

Link copied to clipboard
constructor(strategy: IRR.SolveStrategy? = null, seedRate: Double? = null, irr: Double? = null, didSolve: Boolean = false)

Create empty IRR calculation result

Properties

Link copied to clipboard

Indicates whether this calculation was successfully solved.

Link copied to clipboard
val irr: Double?

The IRR found by the solver. Can be a valid Double result, or one of zero, NaN, +/- infinity, or null.

Link copied to clipboard

The seed rate / initial guess (as a decimal, e.g. 0.15 = 15%) used to initiate the calculation, or 'null'.

Link copied to clipboard

The problem solving strategy used, or null (for example if invalid cash flows were detected before any solve strategy was selected).

Functions

Link copied to clipboard

retrieves a 'sanitized' version of irr clamped to a maximum 'sensible' (default) limit. Refer sanitizeIRR for details and parameters.

retrieves a 'sanitized' version of irr. Specify the maximum sensible limit (or pass null for no limit. Refer sanitizeIRR for details and parameters.

Link copied to clipboard
open override fun toString(): String